package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;

import java.io.IOException;
import java.io.ObjectOutputStream;

//对象流
public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name ="张三";
        int age =25;
        String gender = "男";
        String[] otherInfo = {"是一名学生","西安的","爱健身"};
        Student stu = new Student(name,age,gender,otherInfo);
        System.out.println(stu);
        FileOutputStream fos = new FileOutputStream("student.txt");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(stu);
        System.out.println("写出完毕");
    }
}
